package com.mo.design.pattern.behavior.observer;

public class ConcreteSubject implements Subject {
    @Override
    public void attach(Observer observer) {

    }

    @Override
    public void detach(Observer observer) {

    }

    @Override
    public void notify1() {
        if (state == 1) {
            Observer1 observer1 = new Observer1();
            observer1.update();
        }
        if (state == 0) {
            Observer2 o2 = new Observer2();
            o2.update();
        }
    }

    int state;

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
}
